/**
 * @Project Name:blog-business-service
 * @Package Name:cn.hoofungson.blog.business.service.provider.model.entity.comment
 * @Since JDK 1.8
 */

package cn.hoofungson.blog.business.service.provider.model.entity.comment;

import cn.hoofungson.blog.business.service.provider.model.entity.article.ArticlePO;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @Description: CommentPO
 * @Author 胡松 hoofungson@163.com
 * @Date 2020-03-24 22:42
 * @Version V1.0
 */
@Data
@Entity
@Table(name = "hb_comment")
public class CommentPO implements Serializable {

    @Id
    @GenericGenerator(name = "comment_generator", strategy = "increment")
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "comment_generator")
    private Long id;
    @Column(name = "parent")
    private Long parent;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "archive_id")
    private ArticlePO articlePO;
    @Column(name = "content")
    private String content;
    @Column(name = "nick_name")
    private String nickName;
    @Column(name = "create_time")
    private Date createTime;
}
